home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 260 / SOMC Family Forum 260 - Disc 1.iso / Xtras / Behavior Library.cst / 00044_Script_UI Pointer Change < prev    next >
Text File  |  1997-11-17  |  4KB  |  60 lines

  1. -- Pointer Change
  2.  
  3.  
  4. -- behavior library version 1.1
  5. -- Changes the stage cursor for the movie, add to any sprite on stage.
  6. -- handles ChangeCursor and RestoreCursor messages
  7.  
  8. property  pointerStyle,  CustomImage, CustomMask, currentPointer
  9. property  Rpointerstyle, RCustomImage, RCustomMask
  10.  
  11. property useCustom, useCustomR -- boolean, tru if use custom cursor art for cursor and/or restored cursor
  12.  
  13. property changeBegin, changeEnd
  14.  
  15. on beginSprite me
  16.   if changeBegin then
  17.     changecursor me  
  18.   end if
  19.   
  20. end
  21.  
  22. on EndSprite me  
  23.   if changeEnd then
  24.     restorecursor me  
  25.   end if
  26. end
  27.  
  28. on ChangeCursor me
  29.   set currentPointer = translate_cursor( me, pointerStyle, customImage, customMask, useCustom )
  30.   cursor( currentPointer )
  31. end
  32.  
  33. on restoreCursor me
  34.   set currentPointer = translate_cursor( me, RpointerStyle, RcustomImage, RcustomMask, useCustomR  )
  35.   cursor( currentPointer )
  36. end
  37.  
  38. on translate_cursor me, setting, image, mask, custom
  39.   if custom then
  40.     set val = [ member image, member mask ]
  41.     return val
  42.   end if
  43.   return setting
  44. end
  45.  
  46.  
  47.  
  48. ---
  49.  
  50. on getPropertyDescriptionList
  51.   
  52.   set p_list = [   #changeBegin: [ #comment:    "Change Pointer on BeginSprite:",                     #format:   #boolean, #default:false],   #changeEnd: [ #comment:      "Restore Pointer on EndSprite:",                     #format:   #boolean, #default:false],   #pointerStyle: [ #comment:   "Pointer Image:",                     #format:   #cursor, #default: 1],   #useCustom: [ #comment:      "Use Custom Pointer Image:",                     #format:   #boolean, #default:false],   #customImage: [ #comment:    "Custom Image:",                     #format:   #bitmap,                    #default:    member 1 ],     #customMask: [ #comment:   "Custom Mask:",                     #format:   #bitmap,                    #default:    member 1 ],   #RpointerStyle: [ #comment:  "Restored Pointer Image:",                     #format:   #cursor, #default:1],   #useCustomR: [ #comment:     "Restore Custom Pointer Image:",                     #format:   #boolean, #default:false],   #RcustomImage: [ #comment:   "Restored Custom Image:",                     #format:   #bitmap,                    #default:    member 1 ],     #RcustomMask: [ #comment:  "Restored Custom Mask:",                     #format:   #bitmap,                    #default:    member 1 ]   ]
  53.   return p_list  
  54. end
  55.  
  56. on getBehaviorDescription
  57.   return "Changes the pointer image to one of the pointers included with Director, or to a  1-bit bitmapped castmember. Attach the behavior to a sprite or place it in the script channel." & RETURN & "PARAMETERS:" & RETURN & "ò Change on BeginSprite - Turn this option on to change the pointer in the frame where the sprite begins."  & RETURN & "ò Change on EndSprite - Turn this option on to restore the pointer in the frame after the sprite ends."  & RETURN & "ò Pointer - Choose one of Director's included pointers."  & RETURN & "ò Use Custom - Turn this option on to use a cast member for a pointer instead of one of Director's included pointers."  & RETURN & "ò Custom Image  - ( optional ) Choose which cast member to use as a pointer image. This setting is ignored if Use Custom isn't on."  & RETURN & "ò Custom Mask - ( optional ) Choose a cast member to use as a mask image." & RETURN & "ò Restored Pointer - Choose one of Director's included pointers to be displayed when the sprite ends."  & RETURN & "ò Restore Custom - Turn this option on to display a cast member when the sprite ends."  & RETURN & "ò Restored Custom Image  - ( optional ) Choose a cast member to display as the pointer image when the sprite ends."  & RETURN & "ò Restored Custom Mask - ( optional ) Choose a cast member to use as a mask image when the sprite ends.  " & RETURN & "MESSAGES:" & RETURN & "ò ChangeCursor - Changes the pointer to the specified image."  & RETURN & "ò RestoreCursor - Restores the original pointer image."
  58.   
  59. end
  60.